package com.wxzz.elearing.comment.service.openfeign;


import com.wxzz.elearing.comment.service.openfeign.sentinel.WxUserApiFeignImpl;
import com.wxzz.elearning.common.dto.FeignWxUserDto;
import com.wxzz.elearning.common.vo.ReturnVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(value = "1122-wxzzlearn-user-model",fallback = WxUserApiFeignImpl.class)
public interface IWxUserApiFeign {

    /**
     * 根据条件查询用户id列表
     * @param map
     * @return
     */
    @RequestMapping(value = "/wx-user-api/listWxUserByMap", method = RequestMethod.POST,consumes = MediaType.APPLICATION_JSON_VALUE)
    ReturnVO<List<Long>> listWxUserByMap(@RequestBody Map<String, String> map);

    /**
     * 根据微信用户id查询用户详情
     * @param wxUserId
     * @return
     */
    @RequestMapping(value = "/wx-user-api/selectFeignWxUserDtoByWxUserId", method = RequestMethod.POST)
    FeignWxUserDto selectFeignWxUserDtoByWxUserId(@RequestParam("wxUserId") Long wxUserId);

    /**
     * 根据微信用户id换取用户信息
     * @param wxUserId
     * @return
     */
    @RequestMapping(value = "/wx-user-api/selectWxUserByWxUserId", method = RequestMethod.POST)
    ReturnVO<String> selectWxUserByWxUserId(@RequestParam("wxUserId") Long wxUserId);

}
